import React, { Component } from "react";
import { connect } from "react-redux";
import "./index.scss";
import { Link } from "react-router-dom";
class Recommend extends Component {
  render() {
    return (
      <div className="RecommendWrapper">
       
        {this.props.list.map((item) => ( 
        <Link to={"/detail/"+item.get("id")}>
          <div  key={item.get("id")}>
            <img src={item.get("imgUrl")} alt="" className="RecommendItem"/>
          </div>
          </Link>
        ))}
      </div>
    );
  }
}

const mapState = (state) => ({
  list: state.getIn(["home", "recommendList"]),
});

export default connect(mapState, null)(Recommend);
